<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
<h:head>
	<title>Crea Pacchetto Preconfigurato</title>
</h:head>
 <h:body onload="#{creaPacchettoManagedBean.init()}">    
	<h:form>     
	    <p:menubar>  
	        <p:submenu label="Inserisci prodotti" icon="ui-icon-document">  
	            <p:menuitem value="Hotel" icon="ui-icon-contact" url="crea_hotel.xhtml?faces-redirect=true"/>  
	            <p:menuitem value="Escursioni" icon="ui-icon-contact" url="crea_escursione.xhtml?faces-redirect=true"/>
	            <p:menuitem value="Voli" icon="ui-icon-contact" url="crea_volo.xhtml?faces-redirect=true"/>  
	        </p:submenu>  
	  
	        <p:submenu label="Gestisci prodotti" icon="ui-icon-document">  
	            <p:menuitem value="Hotel" icon="ui-icon-contact" url="cerca_hotel.xhtml?faces-redirect=true"/>  
	            <p:menuitem value="Escursioni" icon="ui-icon-contact" url="cerca_escursioni.xhtml?faces-redirect=true"/>
	            <p:menuitem value="Voli" icon="ui-icon-contact" url="cerca_voli.xhtml?faces-redirect=true"/>  
	        </p:submenu>  
	  
	        <p:submenu label="Pacchetti Preconfigurati" icon="ui-icon-document">  
	            <p:menuitem value="Crea" url="crea_pp.xhtml?faces-redirect.xhtml"/>  
	            <p:menuitem value="Gestisci" url="gestione_pp.xhtml?faces-redirect=true" />  
	        </p:submenu>    
	  
	        <f:facet name="options">  
	            <p:commandButton value="Logout" icon="ui-icon-extlink" action="#{loginManagedBean.logout()}"/>  
	        </f:facet>  
	    </p:menubar>  
  	</h:form>
  	<h:form>
  		<p:messages id="messaggio" showDetail="true" autoUpdate="true" closable="true" /> 
  	</h:form>
  	<h:form id="search_form">
  	<h:panelGrid columns="2">
  			<p:outputLabel value="Nome Pacchetto:"/>
  			<p:inputText value="#{creaPacchettoManagedBean.pacchettoPreconfiguratoDTO.nome}"/>
  		</h:panelGrid>
  		<h:panelGrid columns="2">
  			<p:outputLabel value="Destinazione:"/>
  			<p:inputText value="#{creaPacchettoManagedBean.pacchettoPreconfiguratoDTO.destinazione_pacchetto}"/>
  		</h:panelGrid>
  		<h:panelGrid columns="4">
  			<p:outputLabel value="Date Partenza:"/>
  			<p:dataTable id="output" var="n" value="#{creaPacchettoManagedBean.pacchettoPreconfiguratoDTO.date_possibili}">
				<p:column headerText="Date selezionate">
               		<h:outputText value="#{n.data.toString()}"/>
           		</p:column>
            </p:dataTable>
  			<p:calendar value="#{creaPacchettoManagedBean.dataPossibile.data}" id="calendar" mindate="today" showOn="button" />
  			<p:commandButton value="Aggiungi Data" action="#{creaPacchettoManagedBean.addDataPossibile()}" />
  		</h:panelGrid>
  		<h:panelGrid columns="2">
  			<p:outputLabel value="Durata:"/>
  			<p:spinner id="spinner" value="#{creaPacchettoManagedBean.pacchettoPreconfiguratoDTO.durata}"  min="1"/> 
  		</h:panelGrid>
  		<p:commandButton value="Vai a selezione prodotti" action="#{creaPacchettoManagedBean.selezioneProdotti()}"/>
  	</h:form>  
</h:body>   
</html>